﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HelfenHelfen.Logic.Interfaces;

namespace HelfenHelfen.Web.MVC.Tests.Fakes
{
    public class BonusItemLogicFake : IBonusItemLogic
    {
        public Dictionary<Guid, DataAccess.Entities.BonusItem> listOfBonusItem = new Dictionary<Guid, DataAccess.Entities.BonusItem>();

        public DataAccess.Entities.BonusItem Insert(DataAccess.Entities.BonusItem newBonusItem)
        {
            newBonusItem.BonusItemGUID = Guid.NewGuid();
            
            listOfBonusItem.Add(newBonusItem.BonusItemGUID, newBonusItem);
            return newBonusItem;
        }

        public void Delete(Guid bonusItemId)
        {
            listOfBonusItem.Remove(bonusItemId);
        }

        public DataAccess.Entities.BonusItem Update(DataAccess.Entities.BonusItem updateBonusItem)
        {
            listOfBonusItem[updateBonusItem.BonusItemGUID] = updateBonusItem;
            return updateBonusItem;
        }

        public DataAccess.Entities.BonusItem Get(Guid bonusItemId)
        {
            return listOfBonusItem[bonusItemId];
        }

        public IList<DataAccess.Entities.BonusItem> GetAll()
        {
            return new List<DataAccess.Entities.BonusItem>(listOfBonusItem as IEnumerable<DataAccess.Entities.BonusItem>);
        }
    }
}
